﻿@{
    ViewBag.Title = "Index";
}

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>学生登录</title>
    <meta name="description" content="">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <meta name="robots" content="all,follow">
    <!-- Bootstrap CSS-->
    <link rel="stylesheet" href="~/Content/UI/vendor/bootstrap/css/bootstrap.min.css">
    <!-- Font Awesome CSS-->
    <link rel="stylesheet" href="~/Content/UI/vendor/font-awesome/css/font-awesome.min.css">
    <!-- Fontastic Custom icon font-->
    <link rel="stylesheet" href="~/Content/UI/css/fontastic.css">
    <!-- Google fonts - Poppins -->
    <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Poppins:300,400,700">
    <!-- theme stylesheet-->
    <link rel="stylesheet" href="~/Content/UI/css/style.default.css" id="theme-stylesheet">
    <!-- Custom stylesheet - for your changes-->
    <link rel="stylesheet" href="~/Content/UI/css/custom.css">
    <!-- Favicon-->
    <link rel="shortcut icon" href="~/Content/UI/img/favicon.ico">
    <!-- Tweaks for older IEs-->
    <!--[if lt IE 9]>
        <script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
        <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script><![endif]-->
</head>
<body>
    <div class="page login-page">
        <div class="container d-flex align-items-center">
        <div class="form-holder has-shadow">
                      <div class="row">
            <!-- Logo & Information Panel-->
            <div class="col-lg-6">
              <div class="info d-flex align-items-center">
                <div class="content">
                  <div class="logo">
                    <h1>练习生</h1>
                  </div>
                  <p>练习生选课选课管理系统--学生登录</p>
                </div>
              </div>
            </div>
            <!-- Form Panel    -->
            <div class="col-lg-6 bg-white">
              <div class="form d-flex align-items-center">
                <div class="content">
                  <form method="post" class="form-validate">
                    <div class="form-group">
                      <label for="login-username" class="label-material">学号</label>
                      <input id="login-username" type="text" name="loginUsername" required data-msg="请输入学号" class="input-material">
                      
                    </div>
                    <div class="form-group">
                       <label for="login-password" class="label-material">密码</label>
                      <input id="login-password" type="password" name="loginPassword" required data-msg="请输入密码" class="input-material">
                      
                    </div><!--<a id="login" href="index.html" class="btn btn-primary">登录</a>-->
                    <button id="login" type="button" class="btn btn-primary">登录</button>
                  </form>
                    <a id="login1" href="/login/TeacherIndex">教师登录</a>
                </div>
              </div>
            </div>
          </div>
            </div>

        </div>
    </div>

    <script src="~/Content/UI/vendor/jquery/jquery.min.js"></script>
    <script src="~/Content/UI/vendor/popper.js/umd/popper.min.js"> </script>
    <script src="~/Content/UI/vendor/bootstrap/js/bootstrap.min.js"></script>
    <script src="~/Content/UI/vendor/jquery.cookie/jquery.cookie.js"> </script>
    <script src="~/Content/UI/vendor/chart.js/Chart.min.js"></script>
    <script src="~/Content/UI/vendor/jquery-validation/jquery.validate.min.js"></script>
    <script type="text/javascript">
        $(function () {
            $("#login").click(login);
            //登录js
            function login() {
                var userNum = $("#login-username").val();
                var pwd = $("#login-password").val();
                $.ajax({
                    type: "Post",
                    async: true,
                    url: "/Login/StudentLogin",
                    data: { userNum: userNum, pwd: pwd },
                    success: function (data) {
                        if (data == "ok") {
                            window.location.href = "/Student/Index";
                        } else {
                            alert(data);
                        }
                    }
                });
            }
        });
    </script>

</body>
</html>

